package callLinuxCommand.callLinuxCommand;

import java.io.IOException;
import java.util.Date;
import java.util.Scanner;

import ch.ethz.ssh2.Session;

public class Test {
	public static void main(String[] args) {
		/*CommandUtils.initSession("211.88.12.114", "root", "root20170522");
		System.out.println(CommandUtils.execute("ls /tmp/"));
		CommandUtils.close();*/
		
		
		Scanner in = new Scanner(System.in);
		String inStr;
	
		while(true){
			System.out.print("请输入:");
			
			inStr = in.nextLine();
			
			if("exit".equals(inStr)){
				break;
			}else{
				CommandUtils.initSession("211.88.12.114", "root", "root20170522");
				System.out.println(CommandUtils.execute(inStr));
				CommandUtils.close();
			}
			
		}
		in.close();
		
		
	}
}
